<html>
<head>
<script type="text/javascript" src="loadxmldoc.js"> 
</script>
</head>
<body>

<script type="text/javascript">
xmlDoc=loadXMLDoc("books.xml");

x=xmlDoc.getElementsByTagName('book');
document.writeln(x[0].getAttribute("category"));
x[0].setAttribute("category","food");

document.write(x[0].getAttribute("category"));
</script>
</body>
</html>

